home *** CD-ROM | disk | FTP | other *** search
/ Games Central GT Digital… Q3 Premier Trimestre '98 / GT_DPK.ISO / pc / data / menu.dxr / 00062_Image Switch Cast Members.ls < prev    next >
Encoding:
Text File  |  1995-08-25  |  3.7 KB  |  85 lines

  1. property name, setting, Memberalt, MemberOne, GroupName, MemberAltName
  2.  
  3. on SetState me, state, Addressee
  4.   if voidp(Addressee) then
  5.     do_SetState(me, state)
  6.   else
  7.     case Addressee of
  8.       #all:
  9.         do_SetState(me, state)
  10.       (the name of me):
  11.         do_SetState(me, state)
  12.       (the GroupName of me):
  13.         do_SetState(me, state)
  14.     end case
  15.   end if
  16. end
  17.  
  18. on SwitchStates me, Addressee
  19.   if voidp(Addressee) then
  20.     do_SwitchStates(me)
  21.   else
  22.     case Addressee of
  23.       #all:
  24.         do_SwitchStates(me)
  25.       (the name of me):
  26.         do_SwitchStates(me)
  27.       (the GroupName of me):
  28.         do_SwitchStates(me)
  29.     end case
  30.   end if
  31. end
  32.  
  33. on do_SetState me, state
  34.   set the setting of me to state
  35.   if state = 1 then
  36.     set the member of sprite the spriteNum of me to the MemberOne of me
  37.   else
  38.     set the member of sprite the spriteNum of me to the Memberalt of me
  39.   end if
  40. end
  41.  
  42. on do_SwitchStates me
  43.   if the setting of me = 1 then
  44.     set the setting of me to 2
  45.     set the member of sprite the spriteNum of me to the Memberalt of me
  46.   else
  47.     if the setting of me = 2 then
  48.       set the setting of me to 1
  49.       set the member of sprite the spriteNum of me to the MemberOne of me
  50.     end if
  51.   end if
  52.   return the setting of me
  53. end
  54.  
  55. on beginSprite me
  56.   set the MemberOne of me to the member of sprite the spriteNum of me
  57.   set the Memberalt of me to member the MemberAltName of me
  58.   if setting = 1 then
  59.     do_SetState(me, 2)
  60.   else
  61.     do_SetState(me, 1)
  62.   end if
  63. end
  64.  
  65. on getPropertyDescriptionList
  66.   if the currentSpriteNum = 0 then
  67.     set memdefault to 0
  68.   else
  69.     set memref to the member of sprite the currentSpriteNum
  70.     set castLibNum to the castLibNum of memref
  71.     set memdefault to member (the memberNum of member memref + 1) of castLib castLibNum
  72.   end if
  73.   set p_list to [#name: [#comment: "Item Name:", #format: #symbol, #default: #twostate1], #MemberAltName: [#comment: "Alternate Image Name:", #format: #graphic, #default: memdefault], #setting: [#comment: "Initially Toggled:", #format: #boolean, #default: 0], #GroupName: [#comment: "Group Name:", #format: #symbol, #default: #group1]]
  74.   return p_list
  75. end
  76.  
  77. on getBehaviorDescription
  78.   return "Switches cast members when the SwitchStates message is received. Switches to a particular state when the SetState message is received. Enter a Group Name to include the current sprite in a group of sprites that respond to the same message. " & RETURN & "PARAMETERS:" & RETURN & "ΓÇó Item Name - (optional) Enter an item name to identify the current sprite so that it can receive a specific message. Do not use spaces. Use the name as an argument for the Message Sprite or Message All Sprites behaviors." & RETURN & "ΓÇó Alternate Image - number of castmember whose image will replace normal image.  Must be stored in same cast library as Normal castmember." & RETURN & "ΓÇó Initially Toggled - Turn this option on if sprite's current cast member represents the alternate rather than the normal state of the sprite." & RETURN & "ΓÇó Group Name - (optional) Enter a Group Name to include the current sprite in a group of sprites that respond to the same message. Do not use spaces. Use the name as an argument for the Message Sprite or Message All Sprites behaviors." & RETURN & "MESSAGES:" & RETURN & "ΓÇó SwitchStates [ID] - Switches the sprite's cast member. ID is the Item Name or Group Name of the sprite. Returns the current state of the sprite, 0 (normal) or 1 (alternate)." & RETURN & "ΓÇó SetState {0 or 1}, [ID] - Sets the sprite to state 0 (normal) or 1 (alternate). ID is the Item Name or Group Name of the sprite. If the ID is omitted any sprite receiving the message will SetState."
  79. end
  80.  
  81. on getAssocMembers
  82.   set myPropList to [MemberAltName]
  83.   return myPropList
  84. end
  85.